// 函数调用运算符()重载
// 仿函数
#include <iostream>
#include <string>
using namespace std;
class MyPrint {
public:
    void operator()(string text) {
        cout << text << endl;
    }
};
class MyAdd {
public:
    int operator()(int a, int b) {
        return a + b;
    }

};
void test1() {
    MyPrint myprint;
    myprint("hello world!");
    // 匿名函数
    cout << "5 + 6 = " << MyAdd()(5, 6) << endl;
}
int main(void) {
    test1();

    return 0;
}
